/***************************************************************************
 *   Antc - library                                                        *
 *                                                                         *
 *   Copyright (C) 2008 by kueracel                                         *
 *                         <kueracel@gmail.com>                             *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This library is distributed in the hope that it will be usefull, but  *
 *   WITHOUT ANY WARRACELY; without even the implied warracely of            *
 *   MERCHACELABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
 *   Library General Public License for more details.                      *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place - Suite 330, Boston,                *
 *   MA 02111-1307, USA                                                    *
 ***************************************************************************/


#ifndef ACEL_EXCEPTION_HPP
#define ACEL_EXCEPTION_HPP

#include    <string>
#include    <exception>

namespace   acel
{

class   Exception   :   public  std::exception
{
public  :
    Exception(std::string message, int code=0, const char* filename=NULL, int lineno=0) throw ()
        :   m_strMessage(message), m_iCode(code), m_pszFileName(filename), m_iLineNo(lineno)
    {}
    
    virtual ~Exception() throw () {}
    
public  :

    const std::string&  getMessage(void) const throw () { return m_strMessage; }
    int     getCode(void) const throw () { return m_iCode; }
    const char*     getFileName(void) const throw () { return m_pszFileName; }
    int     getLineNo(void) const throw () { return m_iLineNo; }
    
    const char* what() const throw () { return m_strMessage.c_str(); }
    
private :
    std::string m_strMessage;
    int     m_iCode;
    const char* m_pszFileName;
    int     m_iLineNo;
};  // class Exception
    

enum error_code {
    ACEL_ETOBEDONE   = 0x0701,
    ACEL_ETIMEOUT    = 0x0702,
    ACEL_EPARAMETER  = 0x0703,
    ACEL_EOVERFLOW   = 0x0704,
    
    ACEL_EUNKNOWN    = 0x07FE,
    ACEL_ENOTHING    = 0x07FF
};
    
}   // namespace acel

#endif  // ACEL_EXCEPTION_HPP
